package com.naxian.controller.person;

import com.naxian.mapper.PersonsMapper;
import com.naxian.pojo.Persons;

import com.naxian.service.person.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

public class personController {
    @Autowired
    private PersonService personService;
    @Autowired
    private PersonsMapper personsMapper;

    //用户注册
    @PostMapping("personInfo/personRegister")
    @ResponseBody
    public boolean saveRegister(HttpServletRequest request){
        //1.获得页面参数
        String name = request.getParameter("name");//获得姓名
        String userTel = request.getParameter("userTel");//获得电话
        Long Tel = Long.valueOf(userTel);//String 转换为Long
        String personStatus = request.getParameter("personStatus");//获得求职状态
        Integer perStatus = Integer.valueOf(personStatus);//String 转换为Integer
        String personEmail = request.getParameter("personEmail");//获得邮箱
        String personArea = request.getParameter("personArea");//获得居住地
        //2.获得session中的perId
        Integer perId = Integer.valueOf(request.getParameter("perId"));
        Persons persons = personsMapper.selectByPrimaryKey(perId);
        persons.setPerName(name);
        persons.setPerTel(Tel);
        persons.setPerStatus(perStatus);
        persons.setPerEmail(personEmail);
        persons.setPerAddress(personArea);






return  false;
    }

}
